package com.zdxlz.fcmp.common.core.constant.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @description：
 * @author：aman
 * @date：2025/3/7$ 16:03$
 */
@Getter
@AllArgsConstructor
public enum ClientTypeEnum {

    COMPUTER(1, "电脑终端"),
    MOBILE(2, "手机APP端"),
    MINI_PROGRAMS(3, "手机小程序端"),
    ;

    @EnumValue
    private final Integer code;
    private final String name;

    public static ClientTypeEnum getByCode(Integer code) {
        for (ClientTypeEnum clientTypeEnum : ClientTypeEnum.values()) {
            if (clientTypeEnum.getCode().equals(code)) {
                return clientTypeEnum;
            }
        }
        return null;
    }

    @JsonValue
    public Integer getCode() {
        return code;
    }

}
